home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_doorcam.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  114 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_DoorCam.cog
  4. #
  5. # This is the generic door with a camera attached
  6. #
  7. # [SXC]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.    message  startup
  14.    message  activate
  15.    message    arrived
  16.    message  blocked
  17.    message  timer
  18.  
  19.     thing    switch0         linkid=1              //switch on one side of the door
  20.     thing    switch1         linkid=1              //switch on the other side of the door (optional)
  21.     thing    door0
  22.     thing    player          local
  23.        thing    ghostcampos
  24.  
  25.    flex     doorspeed=1.0
  26.    flex     switchspeed=2.0
  27.    flex     camspeed=1.0
  28.    flex     waittime=5.0
  29.  
  30.    int        flag=0          local
  31.    int      blockcheck=0    local
  32.    int      actcheck=0      local
  33.  
  34. end
  35.  
  36. # ========================================================================================
  37.  
  38. code
  39.  
  40. startup:
  41.     player = GetLocalPlayerThing();
  42.     return;
  43.  
  44. #........................................................................................
  45. activate:
  46.    if ((GetSenderID() == 1) &&
  47.        (GetCurFrame(door0) == 0) && (actcheck == 0))
  48.      {
  49.         PlayMode(player, 60, 0);
  50.         actcheck = 1;
  51.         if (switch0 >= 0) MoveToFrame(switch0, 1, switchspeed);
  52.         if (switch1 >= 0) MoveToFrame(switch1, 1, switchspeed);
  53.     }
  54.     return;
  55.  
  56. #........................................................................................
  57.  
  58. arrived:
  59.  
  60.     if ((GetSenderID() == 1) &&
  61.          (blockcheck == 0))
  62.     {
  63.         blockcheck = 1;
  64.         SetActorFlags(GetLocalPlayerThing(), 0x200000);
  65.         
  66.         //SetCameraFocus(0, ghostcampos);
  67.         //SetCurrentCamera(0);
  68.         MoveToFrame(door0, 1, doorspeed);
  69.         MoveToFrame(ghostcampos, 1, camspeed);
  70.     }
  71.  
  72.     if ((GetSenderRef() == door0) &&
  73.          (flag == 0))
  74.     {
  75.         flag = 1;
  76.         SetTimer(waittime);
  77.         //ClearActorFlags(GetLocalPlayerThing(), 0x200000);
  78.         //SetCurrentCamera(1);
  79.         //SetCameraFocus(1, GetLocalPlayerThing());
  80.     }
  81.  
  82.     if ((GetSenderRef() == door0) &&
  83.        (GetCurFrame(door0) == 0))
  84.     {
  85.         flag = 0;
  86.         blockcheck = 0;
  87.     }
  88.  
  89.     return;
  90.  
  91. #........................................................................................
  92.  
  93. timer:
  94.     if (switch0 >= 0) MoveToFrame(switch0, 0, switchspeed);
  95.     if (switch1 >= 0) MoveToFrame(switch1, 0, switchspeed);
  96.     MoveToFrame(door0, 0, doorspeed);
  97.     MoveToFrame(ghostcampos, 0, camspeed);
  98.     actcheck = 0;
  99.     return;
  100.  
  101. #........................................................................................
  102.  
  103. blocked:
  104.     if (GetSenderRef() == door0)
  105.     {
  106.         MoveToFrame(door0, 1, doorspeed);
  107.         SetTimer(waittime);
  108.     }
  109.     return;
  110.                     
  111. end
  112.  
  113.  
  114.